package com.lele.create;

import com.lele.file.SuperFile;
import com.lele.util.FolderUtil;

public class CreateCatalog {
	public static void createCatalog(SuperFile sf){
		String create_root = sf.getFile_url()+"\\";
		String class_name = sf.getEntityName();
		String[] test = create_root.split("\\\\");
		for (int i = 1; i < test.length; i++) {
			FolderUtil.createFolder(test[i]);
			if (i<test.length-1) {
				test[i+1] = test[i]+"\\"+test[i+1];
			}
		}
		FolderUtil.createFolders(create_root,"action,service,dao,entity,serviceimpl,daoimpl");
		FolderUtil.createFolders(create_root+"action\\",class_name);
		FolderUtil.createFolders(create_root+"dao\\",class_name);
		FolderUtil.createFolders(create_root+"daoimpl\\",class_name);
		FolderUtil.createFolders(create_root+"service\\",class_name);
		FolderUtil.createFolders(create_root+"serviceimpl\\",class_name);
		FolderUtil.createFolders(sf.getProject_root()+"\\WebRoot\\admin\\FMApp\\",sf.getEntityClass()+"App");
		FolderUtil.createFolders(sf.getProject_root()+"\\WebRoot\\admin\\FMApp\\"+sf.getEntityClass()+"App\\","controller");
		FolderUtil.createFolders(sf.getProject_root()+"\\WebRoot\\admin\\FMApp\\"+sf.getEntityClass()+"App\\","model");
		FolderUtil.createFolders(sf.getProject_root()+"\\WebRoot\\admin\\FMApp\\"+sf.getEntityClass()+"App\\","store");
		FolderUtil.createFolders(sf.getProject_root()+"\\WebRoot\\admin\\FMApp\\"+sf.getEntityClass()+"App\\","view");
		
	}
}
